<template>
    <div>
        <el-card>
            <div style="text-align:center;font-size:20px;color:red;padding-top:10px">{{this.ip}}</div>
            <ReturnPage />
            <el-table class="mt20"
                      height="calc(100vh - 250px)"
                      :data="tableData"
                      style="width: 100%">
                <el-table-column prop="host"
                                 label="主机"
                                 align="center">
                </el-table-column>
                <el-table-column prop="name"
                                 label="名称"
                                 align="center">
                </el-table-column>
                <el-table-column prop="recentRecord"
                                 label="最新检查记录"
                                 align="center">
                </el-table-column>
                <el-table-column prop="newData"
                                 label="最新数据"
                                 align="center">
                </el-table-column>
                <el-table-column prop="updateData"
                                 label="更改"
                                 align="center">
                </el-table-column>
                <!-- <el-table-column prop="tags" label="标记" align="center" width="300px">
          <template slot-scope="scope">
            <div class="mb10" v-for="(item, index) in scope.row.tags" :key="index">
              <el-tag effect="dark">{{ item.tag }}</el-tag>
              <el-tag style="margin-left: 10px;" effect="dark">{{ item.value }}</el-tag>
            </div>
          </template>
        </el-table-column> -->
            </el-table>
            <!-- <pagination v-show="total > 0" :total="tableData.length" :page.sync="query.pageNum" :limit.sync="query.pageSize"
        @pagination="getList()" /> -->
        </el-card>
    </div>
</template>

<script>
    import { getNewData_Api } from "@/api/automated/host"
    export default {
        data () {
            return {
                total: 10,
                ip: "",
                query: {
                    pageNum: 1,
                    pageSize: 10,
                },
                tableData: []
            }
        },
        mounted () {
            this.getList()
        },
        methods: {
            async getList () {
                let res = await getNewData_Api(this.$route.query.id)
                let { code, data } = res
                if (code == 200) {
                    this.tableData = data.map(item => {
                        return Object.assign(item, { host: this.$route.query.host })
                    })
                    this.total = data.lennth
                }
            }
        },
        created () {
            this.ip = this.$route.query.ip
        }
    }
</script>

<style lang="scss" scoped></style>